/**
 * Course			:	ISYS2119 - BIS Development 2
 * Assignment		:	03
 * Date due			:	31/08/2012
 * Program 			:	Saigon Bike Rental Catalogue System
 * 
 * Programmer		:	Vuu Ngoc My Linh - s3342015, Tran Thi Van Anh - s3342025
 * 
 * Attributions		:	Lecture slides, Blackboard, Tutorials, Websites (not in reference list document)
 * 
 */

package rmit.ISYS2119.assign03;

import java.util.ArrayList;


public class Accessory {
	

		// Declare Variables
		private int AccessoryId;
		private String accessoryName;
		private String[] types = {"helmet", "jacket", "gloves", "wet weather gear"};
		private  String[] sizes = {"small", "medium", "large", "extra large"};
	//	private String color;
		//s = {"black", "white", "blue", "green", "purple", "red", "grey", "yellow", "orange", "pink"};
		private double rentalCost;
		
		private ArrayList<String> colorSet;
	

		// Methods

		/**
		 * @return the AccessoryId
		 */
		public int getAccessoryId() {
			return AccessoryId;
		}

		/**
		 * @param AccessoryId
		 *            the AccessoryId to set
		 */
		public void setAccessoryId(int AccessoryId) {
			this.AccessoryId = AccessoryId;

		}

		/**
		 * @return the accessoryName
		 */
		public String getAccessoryName() {
			return accessoryName;
		}

		/**
		 * @param accessoryName
		 *            the accessoryName to set
		 */
		public void setAccessoryName(String accessoryName) {
			this.accessoryName = accessoryName;
		}

		
		/**
		 * determine the engine capacity
		 */
		public ArrayList<String> determineAvailableColor(String type) {

			// Determine Color Set for each type
			switch (type) {
			case "helmet":
				colorSet.add("black");
				colorSet.add("white");
				colorSet.add("red");
				break;
			case "jacket":
				colorSet.add("black");
				colorSet.add("white");
				colorSet.add("red");
				colorSet.add("blue");
				colorSet.add("grey");
				colorSet.add("green");
				break;
			case "gloves":
				colorSet.add("black");
				colorSet.add("white");
				break;
			case "wet weather gear":
				colorSet.add("black");
				colorSet.add("white");
				colorSet.add("red");
				colorSet.add("pink");
				colorSet.add("purple");
				colorSet.add("orange");
				colorSet.add("yellow");
				break;
					}
			return colorSet;

		}
		
		/**
		 * 
		 */
		public Accessory() {
			setAccessoryId(0000);
			setAccessoryName("");
			types = new String[types];
			sizes = new String[sizes];
//			setEngineCapacity("");
			setRentalCost("");
//			specifications = new ArrayList<BikeEngineSpecification>();
		}

		public Accessory(int accessoryId, String accessoryName, String[] types,
				String[] sizes, ArrayList<String> colors, double rentalCost) {
			super();
			AccessoryId = accessoryId;
			this.accessoryName = accessoryName;
			this.types = types;
			this.sizes = sizes;
			this.colorSet = colors;
			this.rentalCost = rentalCost;
		}

		public String[] getTypes() {
			return types;
		}

		public void setTypes(String[] types) {
			this.types = types;
		}

		public String[] getSizes() {
			return sizes;
		}

		public void setSizes(String[] sizes) {
			this.sizes = sizes;
		}

		public ArrayList<String> getColors() {
			return colorSet;
		}

		public void setColors(ArrayList<String> colors) {
			this.colorSet = colors;
		}

		public void setRentalCost(double rentalCost) {
			this.rentalCost = rentalCost;
		}

		

		/**
		 * @return the monthlyRent
		 */
		public double getRentalCost() {
			return rentalCost;
		}

		/**
		 * @param monthlyRent
		 *            the monthlyRent to set
		 */
		public void setRentalCost(String type) {
			this.rentalCost = Math.round(calcMonthlyRent(type));
		}

		/**
		 * calculate Monthly Rent
		 */
		public double calcMonthlyRent(String type) {

			// Declare Variables
			double appreciationRate = 0;
			double baseCost = 0;
			double appreciationCost = 0;
		//	double depreciationCost = 0;
			double totalRent = 0;

			// Determine Base Rental Price
			switch (type) {
			case "helmet":
				baseCost = 100000;
				break;
			case "jacket":
				baseCost = 300000;
				break;
			case "gloves":
				baseCost = 200000;
				break;
			case "wet weather gear":
				baseCost = 50000;
				
			}

			// Determine Appreciation Rate
			switch (type) {
			case  "helmet":
				appreciationRate = 0.005;
				break;
			case "jacket":
				appreciationRate = 0.006;
				break;
			case "gloves":
				appreciationRate = 0.004;
				break;
			case "wet weather gear":
				appreciationRate = 0.003;
				break;
						}

			// Define Appreciation Cost
			appreciationCost = baseCost * appreciationRate;

			// Get Calendar
			//Calendar calendar = Calendar.getInstance();

			// Get current year
			//int currentYear = calendar.get(Calendar.YEAR);

			// Define Depreciation Cost
		//	depreciationCost = baseCost
		//			* (((double) currentYear - (double) year) / ((double) 2 * 100));
			totalRent = baseCost + appreciationCost;
					//- depreciationCost;

			return totalRent;

		}

		


		

}
